﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace ProjectPacker
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        /// <param name="args">参数</param>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            switch (args.Count())
            {
                case 5:
                    try
                    {
                        PackerClass.Pack(args[0], args[1], args[2], args[3], args[4]);
                    }
                    catch (System.Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    break;
                case 4:
                    try
                    {
                        PackerClass.Pack(args[0], args[1], args[2], args[3]);
                    }
                    catch (System.Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    break;
                case 3:
                    try
                    {
                        PackerClass.Pack(args[0], args[1], args[2]);
                    }
                    catch (System.Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    break;
                case 2:
                    try
                    {
                        PackerClass.Pack(args[0], args[1]);
                    }
                    catch (System.Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    break;
                case 0:
                    Application.Run(new MainForm());
                    break;
            }

        }
/*
        [STAThread]
        static void Main()
        {
            String[] args = ("Data\\UpdateInfo_Sample_1.txt Data\\newVerUpdate.Strings 2012032908 E:\\ E:\\UpdateInfo.txt").Split(' ');
            TestMain(args);
        }
*/
    }
}
